package com.huai.demo_test1.testSolution;


import lombok.extern.slf4j.Slf4j;

@Slf4j
class Solution {

    public static void reverseString(char[] s) {
        char temp;
        for (int i = 0; i < s.length/2; i++) {
//            temp=s[i];
//            s[i]=s[s.length-1-i];
//            s[s.length-1-i]=temp;

        }
        log.info(String.valueOf(s));
    }

    public static void main(String[] args) {
//        char[] s = {'H','a','n','n','a','h'};
//        char[] s = {'h','e','l','l','o'};
        String s="HHuukdo";
        System.out.println(toLowerCase(s));
//        reverseString(s);
    }

//    Data truncation: Incorrect date value: '2013' for column 'recordDate' at row 1

        public static String toLowerCase(String str) {
            if (str == null && "".equals(str)) {
                return null;
            }

            StringBuilder sb = new StringBuilder();
            for (char c : str.toCharArray()) {
                if (c >= 'A' && c <= 'Z') {
                    sb.append((char)(c + 32));
                } else {
                    sb.append(c);
                }
            }

            return sb.toString();
        }
}